<?php
	DEFINE('H1', 'Testing [some new code]');
	DEFINE('TITLE','Testbed Script');
	require('includes/header.php');
	require_once('db/DBparms.php');
	require('includes/select.class');

?>	
	<h2><?PHP echo H1 ?></h2>
<?php

	$mysqli = new mysqli(DBHOST, DBUSER, DBPWD, "appl");
	
	$result = $mysqli->query("Select id, username from users");
	
	echo "Returned " . $result->num_rows . " rows.<br />";
	
	$users = new Select();
	$users->setLabel('Users');
	$users->setName('users_sel');
	
	for($i = 0; $i < $result->num_rows; $i++)
	{
		$row = $result->fetch_object();
//		wrt("ID: " . $row->id . " Username: " . $row->username);

		$users->setOption(new Option($row->id, $row->username));
	}
	
	$users->render();
	
	


?>

<?php
	require('includes/footer.php');
?>